home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_HDF.idb / usr / freeware / include / hdf / hntdefs.h.z / hntdefs.h
Encoding:
C/C++ Source or Header  |  1999-01-26  |  10.8 KB  |  267 lines

  1. /****************************************************************************
  2.  * NCSA HDF                                                                 *
  3.  * Software Development Group                                               *
  4.  * National Center for Supercomputing Applications                          *
  5.  * University of Illinois at Urbana-Champaign                               *
  6.  * 605 E. Springfield, Champaign IL 61820                                   *
  7.  *                                                                          *
  8.  * For conditions of distribution and use, see the accompanying             *
  9.  * hdf/COPYING file.                                                        *
  10.  *                                                                          *
  11.  ****************************************************************************/
  12.  
  13. /* $Id: hntdefs.h,v 1.4 1997/11/13 15:04:22 koziol Exp $ */
  14.  
  15. /*+ hnt.h
  16.    *** This file contains all the number-type definitions for HDF
  17.    + */
  18.  
  19. #ifndef _HNT_H
  20. #define _HNT_H
  21.  
  22. /* masks for types */
  23. #define DFNT_HDF      0x00000000    /* standard HDF format  */
  24. #define DFNT_NATIVE   0x00001000    /* native format        */
  25. #define DFNT_CUSTOM   0x00002000    /* custom format        */
  26. #define DFNT_LITEND   0x00004000    /* Little Endian format */
  27. #define DFNT_MASK     0x00000fff    /* format mask */
  28.  
  29. /* type info codes */
  30.  
  31. #define DFNT_NONE        0  /* indicates that number type not set */
  32. #define DFNT_QUERY       0  /* use this code to find the current type */
  33. #define DFNT_VERSION     1  /* current version of NT info */
  34.  
  35. #define DFNT_FLOAT32     5
  36. #define DFNT_FLOAT       5  /* For backward compat; don't use */
  37. #define DFNT_FLOAT64     6
  38. #define DFNT_DOUBLE      6  /* For backward compat; don't use */
  39. #define DFNT_FLOAT128    7  /* No current plans for support */
  40.  
  41. #define DFNT_INT8       20
  42. #define DFNT_UINT8      21
  43.  
  44. #define DFNT_INT16      22
  45. #define DFNT_UINT16     23
  46. #define DFNT_INT32      24
  47. #define DFNT_UINT32     25
  48. #define DFNT_INT64      26
  49. #define DFNT_UINT64     27
  50. #define DFNT_INT128     28  /* No current plans for support */
  51. #define DFNT_UINT128    30  /* No current plans for support */
  52.  
  53. #define DFNT_UCHAR8      3  /* 3 chosen for backward compatibility */
  54. #define DFNT_UCHAR       3  /* uchar=uchar8 for backward combatibility */
  55. #define DFNT_CHAR8       4  /* 4 chosen for backward compatibility */
  56. #define DFNT_CHAR        4  /* uchar=uchar8 for backward combatibility */
  57. #define DFNT_CHAR16     42  /* No current plans for support */
  58. #define DFNT_UCHAR16    43  /* No current plans for support */
  59.  
  60. /* Type info codes for Native Mode datasets */
  61. #define DFNT_NFLOAT32   (DFNT_NATIVE | DFNT_FLOAT32)
  62. #define DFNT_NFLOAT64   (DFNT_NATIVE | DFNT_FLOAT64)
  63. #define DFNT_NFLOAT128  (DFNT_NATIVE | DFNT_FLOAT128)   /* Unsupported */
  64.  
  65. #define DFNT_NINT8      (DFNT_NATIVE | DFNT_INT8)
  66. #define DFNT_NUINT8     (DFNT_NATIVE | DFNT_UINT8)
  67. #define DFNT_NINT16     (DFNT_NATIVE | DFNT_INT16)
  68. #define DFNT_NUINT16    (DFNT_NATIVE | DFNT_UINT16)
  69. #define DFNT_NINT32     (DFNT_NATIVE | DFNT_INT32)
  70. #define DFNT_NUINT32    (DFNT_NATIVE | DFNT_UINT32)
  71. #define DFNT_NINT64     (DFNT_NATIVE | DFNT_INT64)
  72. #define DFNT_NUINT64    (DFNT_NATIVE | DFNT_UINT64)
  73. #define DFNT_NINT128    (DFNT_NATIVE | DFNT_INT128)     /* Unsupported */
  74. #define DFNT_NUINT128   (DFNT_NATIVE | DFNT_UINT128)    /* Unsupported */
  75.  
  76. #define DFNT_NCHAR8     (DFNT_NATIVE | DFNT_CHAR8)
  77. #define DFNT_NCHAR      (DFNT_NATIVE | DFNT_CHAR8)  /* backward compat */
  78. #define DFNT_NUCHAR8    (DFNT_NATIVE | DFNT_UCHAR8)
  79. #define DFNT_NUCHAR     (DFNT_NATIVE | DFNT_UCHAR8)     /* backward compat */
  80. #define DFNT_NCHAR16    (DFNT_NATIVE | DFNT_CHAR16)     /* Unsupported */
  81. #define DFNT_NUCHAR16   (DFNT_NATIVE | DFNT_UCHAR16)    /* Unsupported */
  82.  
  83. /* Type info codes for Little Endian data */
  84. #define DFNT_LFLOAT32   (DFNT_LITEND | DFNT_FLOAT32)
  85. #define DFNT_LFLOAT64   (DFNT_LITEND | DFNT_FLOAT64)
  86. #define DFNT_LFLOAT128  (DFNT_LITEND | DFNT_FLOAT128)   /* Unsupported */
  87.  
  88. #define DFNT_LINT8      (DFNT_LITEND | DFNT_INT8)
  89. #define DFNT_LUINT8     (DFNT_LITEND | DFNT_UINT8)
  90. #define DFNT_LINT16     (DFNT_LITEND | DFNT_INT16)
  91. #define DFNT_LUINT16    (DFNT_LITEND | DFNT_UINT16)
  92. #define DFNT_LINT32     (DFNT_LITEND | DFNT_INT32)
  93. #define DFNT_LUINT32    (DFNT_LITEND | DFNT_UINT32)
  94. #define DFNT_LINT64     (DFNT_LITEND | DFNT_INT64)
  95. #define DFNT_LUINT64    (DFNT_LITEND | DFNT_UINT64)
  96. #define DFNT_LINT128    (DFNT_LITEND | DFNT_INT128)     /* Unsupported */
  97. #define DFNT_LUINT128   (DFNT_LITEND | DFNT_UINT128)    /* Unsupported */
  98.  
  99. #define DFNT_LCHAR8     (DFNT_LITEND | DFNT_CHAR8)
  100. #define DFNT_LCHAR      (DFNT_LITEND | DFNT_CHAR8)  /* backward compat */
  101. #define DFNT_LUCHAR8    (DFNT_LITEND | DFNT_UCHAR8)
  102. #define DFNT_LUCHAR     (DFNT_LITEND | DFNT_UCHAR8)     /* backward compat */
  103. #define DFNT_LCHAR16    (DFNT_LITEND | DFNT_CHAR16)     /* Unsupported */
  104. #define DFNT_LUCHAR16   (DFNT_LITEND | DFNT_UCHAR16)    /* Unsupported */
  105.  
  106. /* class info codes for int */
  107. #define        DFNTI_MBO       1    /* Motorola byte order 2's compl */
  108. #define        DFNTI_VBO       2    /* Vax byte order 2's compl */
  109. #define        DFNTI_IBO       4    /* Intel byte order 2's compl */
  110.  
  111. /* class info codes for float */
  112. #define        DFNTF_NONE      0    /* indicates subclass is not set */
  113. #define        DFNTF_HDFDEFAULT 1   /* hdf default float format is ieee */
  114. #define        DFNTF_IEEE      1    /* IEEE format */
  115. #define        DFNTF_VAX       2    /* Vax format */
  116. #define        DFNTF_CRAY      3    /* Cray format */
  117. #define        DFNTF_PC        4    /* PC floats - flipped IEEE */
  118. #define        DFNTF_CONVEX    5    /* CONVEX native format */
  119. #define        DFNTF_VP        6    /* Fujitsu VP native format */
  120. #define        DFNTF_CRAYMPP   7    /* Cray MPP format */
  121.  
  122. /* class info codes for char */
  123. #define        DFNTC_BYTE      0    /* bitwise/numeric field */
  124. #define        DFNTC_ASCII     1    /* ASCII */
  125. #define        DFNTC_EBCDIC    5    /* EBCDIC */
  126.  
  127. /* array order */
  128. #define        DFO_FORTRAN     1    /* column major order */
  129. #define        DFO_C           2    /* row major order */
  130.  
  131. /*******************************************************************/
  132. /* Sizes of number types                                            */
  133. /*******************************************************************/
  134.  
  135. /* first the standard sizes of number types */
  136.  
  137. #    define SIZE_FLOAT32    4
  138. #    define SIZE_FLOAT64    8
  139. #    define SIZE_FLOAT128  16   /* No current plans for support */
  140.  
  141. #    define SIZE_INT8       1
  142. #    define SIZE_UINT8      1
  143. #    define SIZE_INT16      2
  144. #    define SIZE_UINT16     2
  145. #    define SIZE_INT32      4
  146. #    define SIZE_UINT32     4
  147. #    define SIZE_INT64      8
  148. #    define SIZE_UINT64     8
  149. #    define SIZE_INT128    16   /* No current plans for support */
  150. #    define SIZE_UINT128   16   /* No current plans for support */
  151.  
  152. #    define SIZE_CHAR8      1
  153. #    define SIZE_CHAR       1   /* For backward compat char8 == char */
  154. #    define SIZE_UCHAR8     1
  155. #    define SIZE_UCHAR      1   /* For backward compat uchar8 == uchar */
  156. #    define SIZE_CHAR16     2   /* No current plans for support */
  157. #    define SIZE_UCHAR16    2   /* No current plans for support */
  158.  
  159. /* then the native sizes of number types */
  160.  
  161. /* Unusual number sizes */
  162. /* Cray (UNICOS) native number sizes:
  163.     Char = 8 bits, unsigned
  164.     Short=64 int=64 long=64 float=64 double=64 bits
  165.     Long double=128 bits
  166.     Char pointers = 64 bits
  167.     Int pointers = 64 bits
  168. */
  169. /* T3D (CRAYMPP) native number sizes:
  170.     Char = 8 bits, unsigned
  171.     Short=32 int=64 long=64 float=32 double=64 bits
  172.     Long double=64 bits
  173.     Char pointers = 64 bits
  174.     Int pointers = 64 bits
  175. */
  176.  
  177. #if !defined(UNICOS)
  178. #    define SIZE_NFLOAT32    4
  179. #    define SIZE_NFLOAT64    8
  180. #    define SIZE_NFLOAT128  16  /* No current plans for support */
  181.  
  182. #    define SIZE_NINT8       1
  183. #    define SIZE_NUINT8      1
  184. #if defined(CRAYMPP)
  185. #    define SIZE_NINT16      4
  186. #    define SIZE_NUINT16     4
  187. #else
  188. #    define SIZE_NINT16      2
  189. #    define SIZE_NUINT16     2
  190. #endif
  191. #    define SIZE_NINT32      4
  192. #    define SIZE_NUINT32     4
  193. #    define SIZE_NINT64      8
  194. #    define SIZE_NUINT64     8
  195. #    define SIZE_NINT128    16  /* No current plans for support */
  196. #    define SIZE_NUINT128   16  /* No current plans for support */
  197.  
  198. #    define SIZE_NCHAR8      1
  199. #    define SIZE_NCHAR       1  /* For backward compat char8 == char */
  200. #    define SIZE_NUCHAR8     1
  201. #    define SIZE_NUCHAR      1  /* For backward compat uchar8 == uchar */
  202. #if defined(CRAYMPP)
  203. #    define SIZE_NCHAR16     4  /* No current plans for support */
  204. #    define SIZE_NUCHAR16    4  /* No current plans for support */
  205. #else
  206. #    define SIZE_NCHAR16     2  /* No current plans for support */
  207. #    define SIZE_NUCHAR16    2  /* No current plans for support */
  208. #endif
  209. #else  /* !!!!!! SOMEBODY NEEDS TO CHECK THESE !!!!! */
  210. #    define SIZE_NFLOAT32    8
  211. #    define SIZE_NFLOAT64    8
  212. #    define SIZE_NFLOAT128  16  /* No current plans for support */
  213.  
  214. #    define SIZE_NINT8       1
  215. #    define SIZE_NUINT8      1
  216. #    define SIZE_NINT16      8
  217. #    define SIZE_NUINT16     8
  218. #    define SIZE_NINT32      8
  219. #    define SIZE_NUINT32     8
  220. #    define SIZE_NINT64      8
  221. #    define SIZE_NUINT64     8
  222. #    define SIZE_NINT128    16  /* No current plans for support */
  223. #    define SIZE_NUINT128   16  /* No current plans for support */
  224. #    define SIZE_NCHAR8      1
  225. #    define SIZE_NCHAR       1
  226. #    define SIZE_NCHAR       1  /* For backward compat char8 == char */
  227. #    define SIZE_NUCHAR8     1
  228. #    define SIZE_NUCHAR      1  /* For backward compat uchar8 == uchar */
  229. #    define SIZE_NCHAR16     2  /* No current plans for support */
  230. #    define SIZE_NUCHAR16    2  /* No current plans for support */
  231. #endif /* UNICOS */
  232.  
  233. /* then the sizes of little-endian number types */
  234. #    define SIZE_LFLOAT32    4
  235. #    define SIZE_LFLOAT64    8
  236. #    define SIZE_LFLOAT128  16  /* No current plans for support */
  237.  
  238. #    define SIZE_LINT8       1
  239. #    define SIZE_LUINT8      1
  240. #    define SIZE_LINT16      2
  241. #    define SIZE_LUINT16     2
  242. #    define SIZE_LINT32      4
  243. #    define SIZE_LUINT32     4
  244. #    define SIZE_LINT64      8
  245. #    define SIZE_LUINT64     8
  246. #    define SIZE_LINT128    16  /* No current plans for support */
  247. #    define SIZE_LUINT128   16  /* No current plans for support */
  248.  
  249. #    define SIZE_LCHAR8      1
  250. #    define SIZE_LCHAR       1  /* For backward compat char8 == char */
  251. #    define SIZE_LUCHAR8     1
  252. #    define SIZE_LUCHAR      1  /* For backward compat uchar8 == uchar */
  253. #    define SIZE_LCHAR16     2  /* No current plans for support */
  254. #    define SIZE_LUCHAR16    2  /* No current plans for support */
  255.  
  256.     /* sizes of different number types */
  257. #       define MACHINE_I8_SIZE     1
  258. #       define MACHINE_I16_SIZE    2
  259. #       define MACHINE_I32_SIZE    4
  260. #       define MACHINE_F32_SIZE    4
  261. #       define MACHINE_F64_SIZE    8
  262.  
  263.     /* maximum size of the atomic data types */
  264. #       define MAX_NT_SIZE      16
  265. #endif /* _HNT_H */
  266.  
  267.